JS Avoid same if statement in multiple locations

join shbcf.ru